<template>
  <div class="user-info-display">
    <div style="text-align: center">
      <el-avatar
        :size="100"
        class="avatar"
        :icon="avatar ? '' : 'el-icon-user-solid'"
        :src="avatar"
      ></el-avatar>
      <h3 class="normal-text">{{ nickname || username }}</h3>
    </div>
    <div>
      <div class="info secondary-text">
        <i class="el-icon-mobile-phone danger-color"></i>
        {{ phone || "暂无" }}
      </div>
      <div class="info secondary-text">
        <i class="el-icon-message primary-color"></i>
        {{ email || "暂无" }}
      </div>
    </div>

    <slot></slot>
  </div>
</template>

<script>
export default {
  name: "UserInfoDisplay",
  props: {
    nickname: String,
    username: String,
    avatar: String,
    email: String,
    phone: String,
  },
};
</script>

<style lang="scss" scoped>
.user-info-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  position: relative;
  /*padding-top: 20px;*/
  height: 320px;
  box-sizing: border-box;
  .info {
    line-height: 2;
  }

  .avatar {
    position: relative;
    z-index: 2;
  }
}
</style>
